<?php

namespace C\M;

use C\L\Model;
use C\M\Coupons;

class SysSignin extends Model
{
    public function initialize()
    {
        $this->hasOne(
            'reward_num',
            Coupons::class,
            'id',
            [
            "alias" => 'Coupons'
            ]
        );
    }

    public function beforeValidationOnCreate()
    {
        $this->addtime = $this->uptime = time();
        return true;
    }

    public function beforeValidationOnUpdate()
    {
        $this->uptime = time();
        return true;
    }
}
